this.panelBox.connect('allocation-changed',
Lang.bind(this, this._panelBoxChanged));
- this.trayBox = new St.Widget({ name: 'trayBox',
- clip_to_allocation: true,
- layout_manager: new Clutter.BinLayout() });
- this.addChrome(this.trayBox, { affectsInputRegion: false });
-
this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
layout_manager: new Clutter.BinLayout() });
this.uiGroup.add_actor(this.modalDialogGroup);
init: function() {
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
- let trayConstraint = new MonitorConstraint({ primary: true, work_area: true });
- this.trayBox.add_constraint(trayConstraint);
- this.panelBox.bind_property('visible', trayConstraint, 'work-area',
- GObject.BindingFlags.SYNC_CREATE);
-
-
this._loadBackground();
},
// the UI group to get the correct allocation for the struts.
this._updateRegions();
- this.trayBox.hide();
this.keyboardBox.hide();
let monitor = this.primaryMonitor;
this._startingUp = false;
- this.trayBox.show();
this.keyboardBox.show();
if (!Main.sessionMode.isGreeter) {
const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
+const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Atk = imports.gi.Atk;
const Lang = imports.lang;
const Calendar = imports.ui.calendar;
const GnomeSession = imports.misc.gnomeSession;
+const Layout = imports.ui.layout;
const Main = imports.ui.main;
const Params = imports.misc.params;
const Tweener = imports.ui.tweener;
global.sync_pointer();
}));
- this.actor = new St.Widget({ name: 'notification-container',
- reactive: true,
- track_hover: true,
- y_align: Clutter.ActorAlign.START,
- x_align: Clutter.ActorAlign.CENTER,
- y_expand: true,
- x_expand: true,
+ this.actor = new St.Widget({ visible: false,
+ clip_to_allocation: true,
layout_manager: new Clutter.BinLayout() });
- this.actor.connect('key-release-event', Lang.bind(this, this._onNotificationKeyRelease));
- this.actor.connect('notify::hover', Lang.bind(this, this._onNotificationHoverChanged));
-
- this.actor.hide();
- this._notificationFocusGrabber = new FocusGrabber(this.actor);
+ let constraint = new Layout.MonitorConstraint({ primary: true });
+ Main.layoutManager.panelBox.bind_property('visible',
+ constraint, 'work-area',
+ GObject.BindingFlags.SYNC_CREATE);
+ this.actor.add_constraint(constraint);
+
+ this._bannerBin = new St.Widget({ name: 'notification-container',
+ reactive: true,
+ track_hover: true,
+ y_align: Clutter.ActorAlign.START,
+ x_align: Clutter.ActorAlign.CENTER,
+ y_expand: true,
+ x_expand: true,
+ layout_manager: new Clutter.BinLayout() });
+ this._bannerBin.connect('key-release-event',
+ Lang.bind(this, this._onNotificationKeyRelease));
+ this._bannerBin.connect('notify::hover',
+ Lang.bind(this, this._onNotificationHoverChanged));
+ this.actor.add_actor(this._bannerBin);
+
+ this._notificationFocusGrabber = new FocusGrabber(this._bannerBin);
this._notificationQueue = [];
this._notification = null;
this._banner = null;
// state of the pointer when a notification pops up.
this._pointerInNotification = false;
- // This tracks this.actor.hover and is used to fizzle
+ // This tracks this._bannerBin.hover and is used to fizzle
// out non-changing hover notifications in onNotificationHoverChanged.
this._notificationHovered = false;
this.clearableCount = 0;
- Main.layoutManager.trayBox.add_actor(this.actor);
- Main.layoutManager.trackChrome(this.actor, { affectsInputRegion: true });
+ Main.layoutManager.addChrome(this.actor, { affectsInputRegion: false });
+ Main.layoutManager.trackChrome(this._bannerBin, { affectsInputRegion: true });
global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._updateState));
},
_onNotificationHoverChanged: function() {
- if (this.actor.hover == this._notificationHovered)
+ if (this._bannerBin.hover == this._notificationHovered)
return;
- this._notificationHovered = this.actor.hover;
+ this._notificationHovered = this._bannerBin.hover;
if (this._notificationHovered) {
this._resetNotificationLeftTimeout();
// automatically. Instead, the user is able to expand the notification by mousing away from it and then
// mousing back in. Because this is an expected action, we set the boolean flag that indicates that a longer
// timeout should be used before popping down the notification.
- if (this.actor.contains(actorAtShowNotificationPosition)) {
+ if (this._bannerBin.contains(actorAtShowNotificationPosition)) {
this._useLongerNotificationLeftTimeout = true;
return;
}
},
_clampOpacity: function() {
- this.actor.opacity = Math.max(0, Math.min(this.actor._opacity, 255));
+ this._bannerBin.opacity = Math.max(0, Math.min(this._bannerBin._opacity, 255));
},
_onIdleMonitorBecameActive: function() {
this._updateState();
}));
- this.actor.add_actor(this._banner.actor);
+ this._bannerBin.add_actor(this._banner.actor);
- this.actor._opacity = 0;
- this.actor.opacity = 0;
- this.actor.y = -this._banner.actor.height;
+ this._bannerBin._opacity = 0;
+ this._bannerBin.opacity = 0;
+ this._bannerBin.y = -this._banner.actor.height;
this.actor.show();
this._updateShowingNotification();
onCompleteScope: this
};
- this._tween(this.actor, '_notificationState', State.SHOWN, tweenParams);
+ this._tween(this._bannerBin, '_notificationState', State.SHOWN, tweenParams);
},
_showNotificationCompleted: function() {
this._resetNotificationLeftTimeout();
if (animate) {
- this._tween(this.actor, '_notificationState', State.HIDDEN,
- { y: -this.actor.height,
+ this._tween(this._bannerBin, '_notificationState', State.HIDDEN,
+ { y: -this._bannerBin.height,
_opacity: 0,
time: ANIMATION_TIME,
transition: 'easeOutBack',
onCompleteScope: this
});
} else {
- Tweener.removeTweens(this.actor);
- this.actor.y = -this.actor.height;
- this.actor.opacity = 0;
+ Tweener.removeTweens(this._bannerBin);
+ this._bannerBin.y = -this._bannerBin.height;
+ this._bannerBin.opacity = 0;
this._notificationState = State.HIDDEN;
this._hideNotificationCompleted();
}
this._notificationRemoved = false;
if (notification.resident)
- this.actor.remove_actor(this._banner.actor);
+ this._bannerBin.remove_actor(this._banner.actor);
else
this._banner.actor.destroy();
this._banner = null;